home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / Bitmap / Sources / Frame.h < prev    next >
Encoding:
Text File  |  1996-04-25  |  4.1 KB  |  122 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Frame.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Author:                Henri Lamiraux
  7. //
  8. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef BMPFRAME_H
  13. #define BMPFRAME_H
  14.  
  15. // ----- Framework Includes -----
  16.  
  17. #ifndef FWFRAME_H
  18. #include "FWFrame.h"
  19. #endif
  20.  
  21. #ifndef FWFDRGDRP_H
  22. #include "FWDrgDrp.h"
  23. #endif
  24.  
  25. //========================================================================================
  26. //    Forward Declarations
  27. //========================================================================================
  28.  
  29. class FW_CGrowBox;
  30. class CBitmapPart;
  31. class CBitmapSelection;
  32. class CBitmapContent;
  33.  
  34. //========================================================================================
  35. //    class CBitmapFrame
  36. //========================================================================================
  37.  
  38. class CBitmapFrame : public FW_CFrame, public FW_MDraggableFrame, public FW_MDroppableFrame
  39. {
  40. //----------------------------------------------------------------------------------------
  41. //    Initialization/Destruction
  42. //
  43. public:
  44.     FW_DECLARE_AUTO(CBitmapFrame)
  45.     
  46.     CBitmapFrame(Environment* ev, 
  47.                 ODFrame* odFrame, 
  48.                 FW_CPresentation* presentation, 
  49.                 CBitmapPart* bitmapPart,
  50.                 CBitmapContent* bitmapContent);
  51.     virtual ~ CBitmapFrame();
  52.     
  53. //----------------------------------------------------------------------------------------
  54. //    Inherited API
  55. //
  56. public:
  57.     virtual FW_Boolean                DoMenu(Environment* ev, const FW_CMenuEvent& theMenuEvent);
  58.     virtual FW_Boolean                DoAdjustMenus(Environment* ev, FW_CMenuBar* menuBar, FW_Boolean hasMenuFocus, FW_Boolean isRoot);
  59.  
  60.     virtual void                    FocusStateChanged(Environment* ev, ODTypeToken focus, FW_Boolean newState, ODFrame* newOwner);
  61.     virtual void                     FrameShapeChanged(Environment* ev);
  62.     
  63.     virtual ODShape*                AdjustUsedShape(Environment* ev, ODShape* suggestedUsedShape);
  64.     virtual ODShape*                AdjustActiveShape(Environment* ev, ODFacet* facet, ODShape* suggestedActiveShape);
  65.  
  66.     virtual void                    AdjustZoomedWindowSize(Environment *ev, FW_CPoint& proposedSize);
  67.  
  68.     virtual void                     Draw(Environment* ev, ODFacet* odFacet, ODShape* invalidShape);
  69.     virtual void                    BuildThumbnail(Environment* ev, FW_CGraphicContext& gc, FW_CRect& usedRect);
  70.             
  71.     virtual FW_Boolean                 DoMouseDown(Environment* ev, const FW_CMouseEvent& theMouseEvent);
  72.     
  73. #ifdef FW_BUILD_MAC
  74.     virtual ODDragResult            CanAcceptDrop(Environment* ev, ODDragItemIterator* dragInfo);
  75. #endif
  76.  
  77.     virtual FW_Boolean                DoIdle(Environment* ev, const FW_CNullEvent& theNullEvent);
  78.     
  79.     virtual void                    CreateSubViews(Environment* ev);
  80.  
  81.     // ----- Commands -----
  82.     virtual FW_CClipboardCommand*    NewClipboardCommand(Environment* ev, ODCommandID commandID);
  83.  
  84.     virtual FW_CDropCommand*         NewDropCommand(Environment *ev, 
  85.                                         FW_CFrame* frame,
  86.                                         ODDragItemIterator* dropInfo, 
  87.                                         ODFacet* facet, 
  88.                                         const FW_CPoint& dropPoint);
  89.  
  90.     virtual FW_CDragCommand*         NewDragCommand(Environment *ev, 
  91.                                         FW_CFrame* theFrame,
  92.                                         const FW_CMouseEvent& theMouseEvent);
  93.  
  94.     // ----- External/Internalize -----
  95.     virtual void                    ExternalizeFrame(Environment* ev, ODStorageUnitView* storageUnitView);
  96.     virtual void                    InternalizeFrame(Environment* ev, ODStorageUnitView* storageUnitView);
  97.  
  98. //----------------------------------------------------------------------------------------
  99. //    New API
  100. //
  101. public:
  102.     FW_CPoint                        GetZoomRatio(Environment* ev) const;
  103.     void                            AdjustFrameSize(Environment* ev);
  104.  
  105.     void                            CalcUsedRect(Environment* ev, FW_CRect& newUsedRect) const;
  106.     
  107.     ODCommandID                        GetChoosenSize() const
  108.                                         {return fChoosenSize;}
  109.                                 
  110. //----------------------------------------------------------------------------------------
  111. //    Data Members
  112. //
  113. private:
  114.     CBitmapContent*         fBitmapContent;        // Pointer to my content
  115.     ODCommandID                fChoosenSize;        // Choosen Size (50%, 100%, 200%, or fit to frame)
  116.     FW_CRect                fFrameRect;            // The lastest frame shape rect
  117.     CBitmapSelection*        fSelection;
  118.     FW_CIdler*                fIdler;
  119. };
  120.  
  121. #endif
  122.